const readJSONFile = require('./common')

const getRequest = (pathname, query) => {
    if (pathname === '/getJSONFile') {
        return JSON.parse(readJSONFile(query.name))
    }
}

const postRequest = () => {

}

const requestExp = (method, pathname, query) => {
    if (method === 'GET') {
        return getRequest(pathname, query)
    } else {
        return postRequest(pathname, query)
    }
}

module.exports = requestExp